//
//  TopImageViewController.m
//  SegmentDemo
//
//  Created by 塔兮 on 2022/4/12.
//

#import "TopImageViewController.h"

@interface TopImageViewController ()

@property (nonatomic, strong) SegmentPageView *pageView;

@end

@implementation TopImageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self configureView];
}

- (SegmentPageView *)pageView {
    if (!_pageView) {
        _pageView = [[SegmentPageView alloc]initWithFrame:CGRectMake(0, 0, SCWidth, SCHeight - NavBarAndStatusBarHeight)];
        _pageView.topHeight = 60.f;
        _pageView.normalImages = @[@"tx_circle_normal",@"tx_talent_normal"];
        _pageView.selectImages = @[@"tx_circle_select",@"tx_talent_select"];
        _pageView.segmentType = SegmentTopImageTitleType;
        _pageView.topAlignment = SegmentAlignmentCenter;
        _pageView.backgroundColor = UIColorFromHex(@"FFFFFF");
    }
    return _pageView;
}

- (void)configureView {
    self.title = @"图片文字（图片居上）";
    [self.view addSubview:self.pageView];
    
    NSMutableArray *array = [NSMutableArray new];
    NSString *string = @"分";
    for (int i = 0; i < 2; i++) {
        BaseViewController *base = [BaseViewController new];
        base.title = [NSString stringWithFormat:@"%@",string];
//        base.remindNum = 2;
        base.backColor = UIColorFromHex(@"FFFFFF");
//        __weak __typeof(self) weakSelf = self;
//        base.reloadRemind = ^{
//            [weakSelf.pageView viewControllerRemind];
//        };
        [array addObject:base];
        string = [NSString stringWithFormat:@"%@页",string];
    }
    self.pageView.viewControllers = array;
}

@end
